package com.xyy.saas.payment.service.impl;

import com.xyy.saas.payment.dao.mapper.FbankPayRecordsMapper;
import com.xyy.saas.payment.dao.model.FbankPayRecords;
import com.xyy.saas.payment.dao.model.FbankPayRecordsQueryParam;
import com.xyy.saas.payment.service.FbankPayRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

@Service
public class FbankPayRecordsServiceImpl implements FbankPayRecordsService {

    @Autowired
    private FbankPayRecordsMapper fbankPayRecordsMapper;

    @Override
    public Long getTotal(FbankPayRecordsQueryParam param) {
        return fbankPayRecordsMapper.getTotal(param);
    }

    @Override
    public List<FbankPayRecords> queryAllByParam(FbankPayRecordsQueryParam param) {
        return fbankPayRecordsMapper.queryAllByParam(param);
    }

    @Override
    public List<FbankPayRecords> pageAllByParam(FbankPayRecordsQueryParam param) {
        return fbankPayRecordsMapper.pageAllByParam(param);
    }

    @Override
    public FbankPayRecords queryByOrderNo(String orderNo) {
        if(StringUtils.isEmpty(orderNo)) {
            return null;
        }
        return fbankPayRecordsMapper.queryByOrderNo(orderNo);
    }

    @Override
    public FbankPayRecords queryByBusinessNo(String businessNo) {
        if (StringUtils.isEmpty(businessNo)) {
            return null;
        }
        return fbankPayRecordsMapper.queryByBusinessNo(businessNo);
    }

    @Override
    public FbankPayRecords queryOneByBusinessNoAndTradeCodes(String businessNo, List<Integer> tradeCodes) {
        return fbankPayRecordsMapper.queryOneByBusinessNoAndTradeCodes(businessNo, tradeCodes);
    }

    @Override
    public int insertSelective(FbankPayRecords entity) {
        return fbankPayRecordsMapper.insertSelective(entity);
    }

    @Override
    public int deleteById(Long id) {
        return fbankPayRecordsMapper.deleteById(id);
    }

}
